package com.qd.common.panda.domain.entity.user;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 用户银行卡
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserBankDTO extends BaseQuery {

    /**
     * 主键
     */
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DeleteGroup.class)
    private String userId;
    /**
     * 收款户名
     */
    @NotBlank(message = "收款户名不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "收款户名长度不能超过{max}位", groups = DefaultGroup.class)
    private String userName;
    /**
     * 收款卡号
     */
    @NotBlank(message = "收款卡号不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "收款卡号长度不能超过{max}位", groups = DefaultGroup.class)
    private String cardNumber;
    /**
     * 开户银行
     */
    @NotBlank(message = "开户银行不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "开户银行长度不能超过{max}位", groups = DefaultGroup.class)
    private String openBank;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    @Override
    public void freeData() {
        this.userId = null;
        this.userName = null;
        this.cardNumber = null;
        this.openBank = null;
        this.addTime = null;
        this.updateTime = null;
        super.freeData();
    }
}
